<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table {
            border: 1px solid black;
            border-collapse: collapse;
            width: 100%;
        }

        th, td {
            border: 1px solid black;
            padding: 8px;
            text-align: left;
        }
    </style>
</head>
<body>
<table>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>职位</th>
        <th>上司</th>
        <th>入职时间</th>
        <th>工资</th>
        <th>奖金</th>
        <th>部门ID</th>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>程序员</td>
        <td>1006</td>
        <td>1999-8-1</td>
        <td>9872</td>
        <td>133</td>
        <td>10</td>
    </tr>
</table>
</body>
</html>
<script>
    onload = function () {
        let trs = document.getElementsByTagName('tr')
        for (let i = 0; i < trs.length; i++) {
            if (i % 2 === 0) {
                trs[i].style.backgroundColor = "#FFFFFF";
            } else {
                trs[i].style.backgroundColor = '#d2be3c';
            }
        }
        trs[0].style.backgroundColor = "#000000";
        trs[0].style.color = "#FFFFFF";
    }
</script>